<?php

namespace App\Listeners;

use App\Models\Log;
use Carbon\Carbon;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Contracts\Queue\ShouldQueue;

class addLog
{

    public function __construct()
    {
        //
    }

    /**
     * Handle the event.
     *
     * @param  object $event
     * @return void
     */
    public function handle($event)
    {
        $log = new Log();
        $user = $event->user;
        $log->handlers = $user->name;
        $log->logs = $event->content;
        $log->user_id = $user->id;
        if(!$log->save()){
            dd($log);
        }
    }
}
